Magnetic field sensors are used in many applications. For example, for speed or movement detection, magnets may for example be provided on a so-called pole wheel, a magnetic encoder or other magnetic element, thus generating a modulated magnetic field when the pole wheel rotates. The modulation of the field may then be detected by a magnetic field sensor. The magnetic field detected thereby and its modulation are then indicative for example of a rotational speed of the pole wheel. Instead of a pole wheel, e.g. also a linear magnetic element generating a modulated magnetic field when moving may be used. For such a speed detection, in many applications a high accuracy and low jitter are required. To achieve this, in some applications sensors based on giant magnetoresistance (GMR) or tunnel magnetoresistance (TMR) have been increasingly used, although other types of magnetic field sensors like anisotropic magnetoresistance (AMR)-based sensors or Hall sensing elements may also be used. Besides detecting the speed, in some applications, it is desirable to also obtain some measure of the absolute magnetic field.